//
//  HKHttpResponse.h
//  HKHttpManager
//
//  Created by StevenHu on 2018/1/4.
//  Copyright © 2018年 StevenHu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HKHttpConstant.h"


/// token超时
#define USERTOKENINVALID 401101

/// 申请注销中
#define WRITTENOFF 401102

/// 403101 设备、UID、phone封禁
#define USERUIDBAN 403101

/// 用户登录失效，退出
#define USERLGOININVALID 401100

/// 青少年模式
#define USERISTEEN 401103

/**
 网络响应类
 */
@interface HKHttpResponse : NSObject
@property (nullable, nonatomic, copy, readonly) NSData *rawData;
@property (nullable, nonatomic, copy ,readonly) NSDictionary *dictionary;

/**
 请求状态
 */
@property (nonatomic, assign, readonly) HKHttpResponseStatus status;

@property (nullable, nonatomic, copy, readonly) id content;
@property (nullable, nonatomic, copy, readonly) NSString *message;
@property (nonatomic, assign, readonly) NSInteger statueCode;
@property (nonatomic, assign, readonly) NSInteger requestId;
@property (nonnull, nonatomic, copy, readonly) NSURLRequest *request;

- (nonnull instancetype)initWithRequestId:(nonnull NSNumber *)requestId
                                  request:(nonnull NSURLRequest *)request
                             responseData:(nullable NSData *)responseData
                                   status:(HKHttpResponseStatus)status;

- (nonnull instancetype)initWithRequestId:(nonnull NSNumber *)requestId
                                  request:(nonnull NSURLRequest *)request
                             responseData:(nullable NSData *)responseData
                                    error:(nullable NSError *)error;
@end
